Building upon the discovery of hidden directories and files, we now delve into parameter and value fuzzing. This technique focuses on manipulating the parameters and their values within web requests to uncover vulnerabilities in how the application processes input.
Parameters are the messengers of the web, carrying vital information between your browser and the server that hosts the web application. They're like variables in programming, holding specific values that influence how the application behaves.
You'll often spot GET parameters right in the URL, following a question mark (?). Multiple parameters are strung together using ampersands (&). For example:
In this URL:
GET parameters are like postcards – their information is visible to anyone who glances at the URL. They're primarily used for actions that don't change the server's state, like searching or filtering.
While GET parameters are like open postcards, POST parameters are more like sealed envelopes, carrying their information discreetly within the body of the HTTP request. They are not visible directly in the URL, making them the preferred method for transmitting sensitive data like login credentials, personal information, or financial details.
When you submit a form or interact with a web page that uses POST requests, the following happens:
Here's a simplified example of how a POST request might look when submitting a login form:
POST: Indicates the HTTP method (POST).
Parameters are the gateways through which you can interact with a web application. By manipulating their values, you can test how the application responds to different inputs, potentially uncovering vulnerabilities. For instance:
In this section, we'll leverage wenum to explore both GET and POST parameters within our target web application, ultimately aiming to uncover hidden values that trigger unique responses, potentially revealing vulnerabilities.
To follow along, start the target system via the question section at the bottom of the page, replacing the uses of IP:PORT with the IP:PORT for your spawned instance. We will be using the /usr/share/seclists/Discovery/Web-Content/common.txt wordlists for these fuzzing tasks.
Let's first ready our tools by installing wenum to our attack host:
Then to begin, we will use curl to manually interact with the endpoint and gain a better understanding of its behavior:
The response tells us that the parameter x is missing. Let's try adding a value:
The server acknowledges the x parameter this time but indicates that the provided value (1) is invalid. This suggests that the application is indeed checking the value of this parameter and producing different responses based on its validity. We aim to find the specific value to trigger a different and hopefully more revealing response.
Manually guessing parameter values would be tedious and time-consuming. This is where wenum comes in handy. It allows us to automate the process of testing many potential values, significantly increasing our chances of finding the correct one.
Let's use wenum to fuzz the "x" parameter's value, starting with the common.txt wordlist from SecLists:
Analyzing the results, you'll notice that most requests return the "Invalid parameter value" message and the incorrect value you tried. However, one line stands out:
This indicates that when the parameter x was set to the value "OA...," the server responded with a 200 OK status code, suggesting a valid input.
If you try accessing http://IP:PORT/get.php?x=OA..., you'll see the flag.
Fuzzing POST parameters requires a slightly different approach than fuzzing GET parameters. Instead of appending values directly to the URL, we'll use ffuf to send the payloads within the request body. This enables us to test how the application handles data submitted through forms or other POST mechanisms.
Our target application also features a POST parameter named "y" within the post.php script. Let's probe it with curl to see its default behavior:
The -d flag instructs curl to make a POST request with an empty body. The response tells us that the parameter y is expected but not provided.
As with GET parameters, manually testing POST parameter values would be inefficient. We'll use ffuf to automate this process:
The main difference here is the use of the -d flag, which tells ffuf that the payload ("y=FUZZ") should be sent in the request body as POST data.
Again, you'll see mostly invalid parameter responses. The correct value ("SU...") will stand out with its 200 OK status code:
Similarly, after identifying "SU..." as the correct value, validate it with curl:
In a real-world scenario, these flags would not be present, and identifying valid parameter values might require a more nuanced analysis of the responses. However, this exercise provides a simplified demonstration of how to leverage ffuf to automate the process of testing many potential parameter values.